package com.crm.service.impl;

import java.util.Date;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.dao.FinanceZpExpendMapper;
import com.crm.model.FinanceZpExpend;
import com.crm.service.FinanceZpExpendService;
import com.crm.util.UUIDUtil;

@Service
public class FinanceZpExpendServiceImpl extends BaseServiceImpl<FinanceZpExpend> implements FinanceZpExpendService{

	@Autowired
	private FinanceZpExpendMapper expendMapper;
	
	@Override
	@Transactional
	public int insert(FinanceZpExpend record) {
		
		String uuid = UUIDUtil.getUUID();
		record.setZpExpendId(uuid);
		record.setUpdateStatus((byte)1);
		record.setApplicantDate(new Date());
		return super.insert(record);
	}
	
	@Override
	public void deleteById(String zpExpendId) {
		
		expendMapper.deleteById(zpExpendId);
	}

	@Override
	public FinanceZpExpend getTotalIncome(FinanceZpExpend t) {
		
		return expendMapper.getTotalIncome(t);
	}

}
